package com.ewzj.bigdata.app.config.netmodel

import com.ewzj.bigdata.mvp.model.bean.UserBean
import com.ewzj.bigdata.mvp.model.rspbean.*
import io.reactivex.Observable
import okhttp3.MultipartBody
import okhttp3.RequestBody
import okhttp3.ResponseBody
import retrofit2.http.*

/**
 * author:zhangjing
 * 作用:
 * return:
 */
interface CommonService {

    @POST(Api.LOGIN)
    fun Login(@Body logindata: RequestBody): Observable<BaseData<TokenBean>>

    @POST(Api.SMS)
    fun Sms(@Body mobile: RequestBody): Observable<BaseData<Any>>

    //第三方登录
    @POST(Api.ThirdLogin)
    fun LoginbyThird(@Body thirddata: RequestBody): Observable<BaseData<TokenBean>>

    //视频列表
    @POST(Api.VIDEOLIST)
    fun videoList(@Body pagedata: RequestBody): Observable<BaseData<VideosData>>

    //    房源列表
    @POST(Api.HOURSELIST)
    fun hourseList(@Body pagedata: RequestBody): Observable<BaseData<HomeBean>>

    //    资讯列表
    @POST(Api.INFOLIST)
    fun infoList(@Body pagedata: RequestBody): Observable<BaseData<InfosData>>

    //    获取个人信息
    @POST(Api.USERDETAIL)
    fun userInfo(): Observable<BaseData<UserBean>>

    //    装修广告位
    @POST(Api.AD)
    fun decBanner(@Body addata: RequestBody): Observable<BaseData<BaseListData<DecBean>>>

    //    装修图片列表
    @POST(Api.DECPIC)
    fun decPiclist(@Body pagedata: RequestBody): Observable<BaseData<BaseListData<DecPicBean>>>

    //    装修公司列表
    @POST(Api.DECCOMPANY)
    fun decCompanylist(@Body pagedata: RequestBody): Observable<BaseData<DecCompanysBeans>>

    //    数据列表
    @POST(Api.DATALIST)
    fun datalist(@Body pagedata: RequestBody): Observable<BaseData<BaseListData<Databean>>>

    //    添加评论
    @POST(Api.COMMENT)
    fun doComment(@Body pagedata: RequestBody): Observable<BaseData<CommentBean>>

    //    点赞或者点踩
    @POST(Api.PRAISE)
    fun doPraise(@Body pagedata: RequestBody): Observable<BaseData<String>>

    //    我的消息
    @POST(Api.MSG)
    fun getMsg(@Body pagedata: RequestBody): Observable<BaseData<BaseListData<MsgBean>>>


    //    最近浏览
    @POST(Api.RECENT_SCAN)
    fun recentScan(@Body pagedata: RequestBody): Observable<BaseData<BaseListData<CollectionBean>>>

    //    图片上传
    @Multipart
    @POST(Api.PIC_UPLOAD)
    fun uploadPic(@Part partList: List<MultipartBody.Part>): Observable<BaseData<List<String>>>

    //  修改用户信息
    @POST(Api.UPDATE_USER)
    fun updateUser(@Body pagedata: RequestBody): Observable<BaseData<Any>>

    //    收藏列表
    @POST(Api.COLLECTION)
    fun collectionlist(@Body pagedata: RequestBody): Observable<BaseData<BaseListData<CollectionBean>>>

    //   订阅筛选条件
    @POST(Api.SUB_FILTER)
    fun subFilterlist(@Body pagedata: RequestBody): Observable<SubFilterBean>

    //   订阅筛选条件
    @POST(Api.SUB_List)
    fun sublist(@Body pagedata: RequestBody): Observable<BaseData<BaseListData<SubBean>>>


    //    查询房产类型
    @POST(Api.TYPE)
    fun findHourseType(@Body pagedata: RequestBody): Observable<BaseData<BaseListData<HourseType>>>


    //    城市列表
    @POST(Api.CITYLIST)
    fun citylist(@Body pagedata: RequestBody): Observable<BaseData<CityBean>>

    @POST(Api.CITY_SEARCH)
    fun getcitybyname(@Body body: RequestBody): Observable<BaseData<CitySearchBean>>

    //    @POST(Api.CITYLIST)
    //    Observable<BaseData<BaseListData<CitygroupBean.ListEntity.Entity>>> hotcitylist(@Body RequestBody pagedata);
    @POST(Api.HOT_SEARCH)
    fun gethomehotwords(@Body body: RequestBody): Observable<BaseData<HotKeyBean>>

    @POST(Api.HOT_SEARCH)
    fun gethotwords(): Observable<BaseData<HotKeyBean>>

    //    全局搜索
    @POST(Api.GLOBAL_SEARCH)
    fun allsearch(@Body body: RequestBody): Observable<BaseData<BaseListData<HomeBean>>>


    //    下载文件
    @Streaming
    @GET
    fun downloadFile(@Url fileUrl: String): Observable<ResponseBody>

//    百度推送

    //    收藏
    @POST(Api.COLLECT)
    fun doCollect(@Body body: RequestBody): Observable<BaseData<Any>>

    // 意见反馈
    @POST(Api.FEEDBACK)
    fun feedBack(@Body body: RequestBody): Observable<BaseData<Any>>

    //    手机绑定
    @POST(Api.BINDMOBILE)
    fun phoneBinding(@Body body: RequestBody): Observable<BaseData<Any>>

    //    配置接口
    @POST(Api.CONFIG)
    fun getconfig(@Body body: RequestBody): Observable<BaseData<ConfigBean>>

    //    取消订阅
    @POST(Api.MERBER_DEL)
    fun cancelSub(@Body body: RequestBody): Observable<BaseData<Any>>

    //    第三版本接口
    @POST(Api.HOME_V3)
    fun homeV3(@Body body: RequestBody): Observable<BaseData<RspHomeData>>

    //V3版新房列表
    @POST(Api.NEWHOME_V3)
    fun newhomeV3(@Body body: RequestBody): Observable<BaseData<BaseListData<HomeBean>>>

    //区域列表
    @POST(Api.NEWHOME_V3)
    fun newRegionV3(@Body body: RequestBody): Observable<BaseData<BaseListData<ReginBean>>>

    //v3版二手房列表
    @POST(Api.OLDHOME_V3)
    fun oldhomeV3(@Body body: RequestBody): Observable<BaseData<BaseListData<HomeBean>>>

    //v3租房列表
    @POST(Api.RENTHOME_V3)
    fun renthomeV3(@Body body: RequestBody): Observable<BaseData<BaseListData<HomeBean>>>

    //原创新闻列表
    @POST(Api.ORIGIN_V3)
    fun orginTopicV3(@Body body: RequestBody): Observable<BaseData<BaseListData<RspOriginBean>>>

    @GET
    fun getWebcontent(@Url url: String): Observable<String>

    @POST(Api.SCAN_REC)
    fun ScanRecV3(@Body body: RequestBody): Observable<BaseData<Any>>

    //    广告列表
    @POST(Api.AD_LIST)
    fun getAdlist(@Body body: RequestBody): Observable<BaseData<AdBean>>

    //1 取为您推荐 2 二手房 3租房 4新房
    @POST(Api.HOME_V3)
    fun getHomelist(@Body body: RequestBody): Observable<BaseData<RspHomeData>>

    @POST(Api.HOUSE_SECO)
    fun getMapOldHomelist(@Body body: RequestBody): Observable<BaseData<BaseListData<HomeBean>>>

    @POST(Api.HOUSE_RENT)
    fun getMapRentHomelist(@Body body: RequestBody): Observable<BaseData<BaseListData<HomeBean>>>
    //    专题入口
    @POST(Api.Topic_Enter)
    fun getTopic_Enter(@Body body: RequestBody): Observable<BaseData<BaseListData<TopicEnterBean>>>

    //原创新闻列表
    @POST(Api.NEWS_TYPE)
    fun orginTypeV3(@Body body: RequestBody): Observable<BaseData<BaseListData<RspOriginBean>>>
}